#ifndef CAMERA_H
#define CAMERA_H

#include <QObject>
#include <QtCore>
#include <QTimer>
#include<opencv2/core/core.hpp>
#include<opencv2/highgui/highgui.hpp>
#include<opencv2/imgproc/imgproc.hpp>
#include <QQuickImageProvider>
#include "imagepro.h"
class Camera : public QObject
{
    Q_OBJECT
    Q_PROPERTY(int interval READ interval WRITE setInterval NOTIFY intervalChanged);
  //Q_PROPERTY(int time READ time WRITE settime NOTIFY timeChanged);
    Q_PROPERTY(QImage image READ image WRITE setImage NOTIFY imageChanged);
private:
    cv::VideoCapture capwebcame;

    cv::Mat matOriginal;
    cv::Mat matProceesed;
    QImage * qimQriginal;
    QTimer * m_timer;
    ImagePro imp;
public:
    explicit Camera(QObject *parent = 0);
    ~Camera();
    void Showstatue(void);
    QTimer * tmrTmier;
   // void settime();

    void timeChanged();
    void setInterval(int);
    int interval();
    ////
    void setImage(const QVariant &v);
    void cap();
    QImage image();
    ///
signals:
    void out();
    void intervalChanged();
    void imageChanged();
    void timestart();
public slots:
    void processFrameAndUpdateGUI(void);
    //void Timeout();


};

#endif // CAMERA_H
